﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace _12_Lambda表达式_无参无返回值
{
    /// <summary>
    /// 无参无返回值的委托
    /// </summary>
    public delegate void DoSomeDelegate();
    
    internal class Program
    {
        static void Main(string[] args)
        {
            int index = 1;
            DoSomeDelegate doSomeDelegate = () => Console.Write("[{0}]", DateTime.Now); 
            doSomeDelegate += () => Console.Write("日志消息-" + index++);
            doSomeDelegate += () => Console.WriteLine();

            //调用委托
            doSomeDelegate.Invoke();
            doSomeDelegate.Invoke();
            doSomeDelegate.Invoke();
            
            
            Console.ReadKey();
        }
    }
}
